import axios from '@/axios.js'

export function login(body){
    return axios.post("/v1/login",body)
}

// 验证token
export function verifyToken(){
    return axios.post("/v1/verifyToken")
}

//上传头像
export function uploadAvatarImage(body){
    return axios.post("/files/editor/upload",body)
}

//上传文章图像
export function uploadEditImage(body){
    return axios.post("/files/upload",body)
}

export function logout(){
    return new Promise((resolve,reject)=>{
        resolve({
            "msg": "ok",
            "data": "退出登录成功"
        })
        reject({
            "msg": "非法token，请先登录！",
            "errorCode": 20000
        })
    })
}

export function updatepassword(data){
    return new Promise((resolve,reject)=>{
        resolve({
            "msg": "ok",
            "data": true
        })
        reject({
            "msg": "非法token，请先登录！",
            "errorCode": 20000
        })
    })
}
